package com.zf.shuashua.widget;

import android.content.Context;
import android.util.AttributeSet;

import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer;

public class VideoResolution16_9 extends StandardGSYVideoPlayer {

    public VideoResolution16_9(Context context, Boolean fullFlag) {
        super(context, fullFlag);
    }

    public VideoResolution16_9(Context context) {
        super(context);
    }

    public VideoResolution16_9(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        int widthSize = MeasureSpec.getSize(widthMeasureSpec);
        final int newMeasureSpec = MeasureSpec.makeMeasureSpec((int) (widthSize * 9F / 16F), MeasureSpec.EXACTLY);
        super.onMeasure(widthMeasureSpec, newMeasureSpec);
    }
}
